package com.wy.dao;

import com.wy.bean.HouseBean;
import com.wy.model.sys.Houses;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface HousesMapper {
    int deleteByPrimaryKey(Integer id);


    int deleteHouses(@Param("groupId") List<String> groupId);

    int insert(HouseBean record);

    int insertSelective(Houses record);

    Houses selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Houses record);

    int updateByPrimaryKey(HouseBean record);

    /**
     * 获取房屋列表
     *
     * @param pageSize
     * @param start
     * @return
     */
    public List<HouseBean> houseList(@Param("pageSize") Integer pageSize, @Param("start") Integer start,
                                     @Param("buildingId") Integer buildingId, @Param("houseCode") String houseCode,
                                     @Param("rids") List<String> rids,@Param("residenceId") Integer residenceId);

    /**
     * 获取房屋列表的总量
     *
     * @param pageSize 每页显示条数
     * @param start 起始页数
     * @return
     */
    public Integer houseSize(@Param("pageSize") Integer pageSize, @Param("start") Integer start,
                              @Param("buildingId") Integer buildingId,@Param("houseCode") String houseCode,
                              @Param("rids")List<String> rids,@Param("residenceId") Integer residenceId);

    /**
     * 根据楼栋id获取房屋
     * @param buildingId
     * @return
     */
    public List<Houses> getHousesByBuildingId(@Param("buildingId") Integer buildingId);

    /**
     * 根据小区id获取房屋
     * @param residenceId
     * @return
     */
    public List<HouseBean> getHousesByResidenceId(@Param("residenceId") Integer residenceId);

    /**
     * 获取所有房屋信息
     * @return
     */
    List<Houses> getHouseList();

    List<HouseBean> getHouseListImport(List<HouseBean> list);

    int insertBatch(List<HouseBean> list);

    List<String> getUnitByBuildingId(@Param("buildingId") Integer buildingId);

    List<Houses> getHousesByBidUnit(@Param("buildingId") Integer buildingId,@Param("unitName") String unitName);
}